#define _CRT_SECURE_NO_WARNINGS
#include"list.h"
int main() {
	List* head = NULL;
	int n, i;
	cin >> n;
	int num = 0;
	for (i = 0; i < n; i++)
	{
		cin >> num;
		addlist(&head, num);
	}
	//printlist(&head);
	int ret=is_palindrome(&head);
	if (ret==1)
	{
		cout << "yes" << endl;
	}
	else
	{
		cout << "no" << endl;
	}
	system("pause");
}